package com.raspositos.guitarfrik.android;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.IOException;

import android.content.Context;

public class UglyWorkaround {



	public static void workAround(Context ctc) throws IOException{
		for (Prefs.BuiltInIntros intro : Prefs.BuiltInIntros.values()) {
//			Log.d("GuitarFrik", "Creating file:"+intro.toFileName());
			BufferedOutputStream  out = new BufferedOutputStream(ctc.openFileOutput(intro.toFileName(), Context.MODE_WORLD_READABLE));
			BufferedInputStream in = new BufferedInputStream(ctc.getResources().openRawResource(intro.getResource()));
			int c;
			while (( c = in.read() )!= -1){
				out.write(c);
			}
			out.flush();
			out.close();
			in.close();
		}
	}
	
}
